import java.awt.Color;

/**
 * Simple enum used to specify which player is in being used.
 * 
 * @author Sam Snyder
 *
 */
public enum PlayerSelect {
	/**
	 * Corresponds to Player1.
	 */
	P1, 
	
	/**
	 * Corresponds to Player2.
	 */
	P2;
	
	/**
	 * @return the other player of whatever this is called on.
	 */
	public PlayerSelect other() {
		switch (this) {
		case P1:
			return P2;
		default:
			return P1;	
		}
	}
	
	/**
	 * @return the name of the player in text.
	 */
	@Override
	public String toString() {
		switch (this) {
		case P1:
			return "Player1";
		default:
			return "Player2";
		}
	}
	
	/**
	 * @return the color associated with the given player
	 */
	public Color color() {
		switch (this) {
		case P1:
			return Color.BLUE;
		default:
			return Color.RED;
		}
	}
}
